// 路由配置文件
import Vue from "vue"
import VueRouter from "vue-router"
import HomeContainer from "./components/tabbar/HomeContainer.vue"
import MemberContainer from "./components/tabbar/MemberContainer.vue"
import CartContainer from "./components/tabbar/CartContainer.vue"
import SearchContainer from "./components/tabbar/SearchContainer.vue"
import NewsList from "./components/news/NewsList.vue"
import NewsDetails from "./components/news/NewsDetails.vue"

// 手动注册路由
Vue.use(VueRouter)

// 创建路由构造器
var router = new VueRouter({
    routes: [ //配置路由规则
        {
            path: '/',
            redirect: "/home" //重定向
        },
        {
            path: "/home",
            component: HomeContainer
        },
        {
            path: "/member",
            component: MemberContainer
        },
        {
            path: "/cart",
            component: CartContainer
        },
        {
            path: "/search",
            component: SearchContainer
        },
        {
            path: "/home/newsList",
            component: NewsList
        },
        {
            path: "/home/newsList/:id",
            component: NewsDetails
        }


    ],
    linkActiveClass: "mui-active" //设置路由高亮的类
})
export default router //输出路由模块